# (C) Copyright 2021-2023 Intel Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
"""Build crt_utils component"""


def scons():
    """Scons function"""

    Import('env', 'conf_dir')

    env.d_add_build_rpath()

    cenv = env.Clone()

    cenv.AppendUnique(CPPPATH=[Dir('../../mgmt').srcnode()])

    cenv.require('protobufc', 'mercury')

    # Generate cart utility shared objects
    cart_utils_objs = cenv.SharedObject(['crt_utils.c'], SHOBJPREFIX='s_')
    Export('cart_utils_objs')

    env.Install(conf_dir, ['memcheck-cart.supp', 'fault-inject-cart.yaml'])


if __name__ == "SCons.Script":
    scons()
